import {api} from "@/boot/axios";

export function getAll(param) {
    // check if param is form data
    if (param instanceof FormData) {
        return api({
            url: '/employee/getall',
            method: 'get',
            data: param
        })
    }
    return api({
        url: '/employee/getall',
        method: 'get',
        param
    })

}

export function updateOne(formData) {
    return api({
        url: '/employee/update',
        method: 'post',
        data: formData
    })
}

export function deleteOne(formData) {
    return api({
        url: '/employee/delete',
        method: 'post',
        data: formData
    })

}
export function getUser(user_id) {
    return api({
        url: '/project_user/user',
        method: 'get',
        params: {
            user_id: user_id
        }
    })
}
export function getEmployeeByDeptId(dept_id) {
    return api({
        url: '/employee/getemployeebydept',
        method: 'get',
        params: {
            dept_id: dept_id
        }
    })
}

